package com.chanzany.mediator;

/**
 * @Author ChanZany
 * @Date 2021/10/19 11:07
 * @Version 1.0
 */
public class Client {
    public static void main(String[] args) {
        //创建中介者对象
        Mediator mediator = new ConcreteMediator();
        //创建租房者对象
        Tenant tenant = new Tenant("李四", mediator);
        //创建房主对象
        HouseOwner houseOwner = new HouseOwner("张三", mediator);
        //中介结构要知道房主和租房者
        mediator.register(tenant);
        mediator.register(houseOwner);

        tenant.contact("想租三室一厅");
        houseOwner.contact("三室一厅4800");
    }
}
